//
// Created by dong on 2025/10/22.
//

#include "SLine.h"

SLine::SLine(SDL_Point begin, SDL_Point end, SDL_Color color):m_name("Line")
{
    p1 = begin;
    p2 = end;
    setColor(color);
}

void SLine::render(SDL_Renderer* render)
{
    SDL_SetRenderDrawColor(render,m_color.r,m_color.g,m_color.b,0);
    SDL_RenderDrawLine(render,p1.x,p1.y,p2.x,p2.y);
}

string SLine::name() const
{
    return this->m_name;
}
